package com.example.demo.SpringIoC.controller;

import com.example.demo.SpringIoC.model.User;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;

@Service
public class UserController {
    @Bean(name={"u1","u2"})
    public User user1(){
        User user=new User();
        user.setName("Maybe");
        user.setAge(15);
        return user;
    }
    @Bean
    public User user2(){
        User user=new User();
        user.setName("02");
        user.setAge(17);
        return user;
    }

}
